<?php

namespace App\Services\Api;

/**
 * 发布需求
 */
class DEMAND30001
{
    public $apiCode = 'DEMAND#30001';

    public function getInitPostData($postData)
    {
        if ($postData['needle_type'] == 1) {
            list($p, $c) = explode(',', $postData['area_id']);
            return [
                'custId' => $postData['custId'],
                'contact' => $postData['contact'],
                'telephone' => $postData['telephone'],
                'other' => $postData['other'],
                'type' => $postData['type'],
                'domain' => $postData['domain'],
                'addr' => $postData['addr'],

            ];
        } else if ($postData['needle_type'] == 2) {
            list($p, $c) = explode(',', $postData['area_id']);
            return [
                'custId' => $postData['custId'],
                'contact' => $postData['contact'],
                'telephone' => $postData['telephone'],
                'other' => $postData['other'],
                'type' => $postData['type'],
                'domain' => $postData['domain'],
                'addr' => $postData['addr'],
            ];
        } else if ($postData['needle_type'] == 3) {
            list($p, $c) = explode(',', $postData['area_id']);
            return [
                'custId' => $postData['custId'],
                'contact' => $postData['contact'],
                'telephone' => $postData['telephone'],
                'other' => $postData['other'],
                'type' => $postData['type'],
                'use_of_funds' => $postData['use_of_funds'],
                'expected_amount' => $postData['expected_amount'],
                'nature' => $postData['nature'],
                'addr' => $postData['addr'],
            ];
        } else if ($postData['needle_type'] == 4) {
            return [
                'custId' => $postData['custId'],
                'contact' => $postData['contact'],
                'telephone' => $postData['telephone'],
                'other' => $postData['other'],
                'domain' => $postData['domain'],
                'techordev_type' => $postData['techordev_type'],
            ];
        } else if ($postData['needle_type'] == 0) {
            return [
                'custId' => $postData['custId'],
                'contact' => $postData['contact'],
                'telephone' => $postData['telephone'],
                'other' => $postData['other'],
            ];
        }
    }

    public function getInitApiCode()
    {
        return $this->apiCode;
    }

}
